
/**
 * 项目公共配置
 */
import querystring from 'querystring'

let query = querystring.parse(window.location.search.slice(1))

let domain
if (process.env.VUE_APP_ENV === 'test') {
  domain = 'https://test.csg.h5.waper1.com'
} else if (process.env.VUE_APP_ENV === 'production') {
  domain = 'https://120.76.22.61:8087'
} else {
  domain = 'https://test.csg.h5.waper1.com'
}

// 开发环境
if (process.env.NODE_ENV === 'development') {
  query.sa_id = 'a0b16056706b0ba80702b5d10d13cd48'
  query.access_token = '0f081a9521f25d7bb9f49808c9fb5cc8'
  query.wx_nickname = '我是昵称'
  query.wx_head = 'http://thirdwx.qlogo.cn/mmopen/vi_32/No5dRHre1iaOQPFRcw8gYDNOqljric4Q7RbklGCag6DHhf5riaLUF1AMmUcLTkspBPqMb6oAAFR3ICnapib6Vxib4wQ/132'
}

export default {
  domain, // 接口域名

  /**
   * 微信URL参数
   */
  sa_id: query.sa_id,
  access_token: query.access_token,
  wx_nickname: query.wx_nickname ? decodeURIComponent(query.wx_nickname) : '',
  wx_head: query.wx_head ? decodeURIComponent(query.wx_head) : ''
}
